package Work;

class Person {
    private String name;
    private String sex;
    private int age;

    public Person(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    @Override
    public String toString() {
        return "姓名：" + name + ", 性别：" + sex + ", 年龄：" + age;
    }
}

class Student extends Person {
    private int no;
    private int scoreEn;
    private int scoreMath;
    private int scoreCh;

    public Student(String name, String sex, int age, int no, int scoreEn, int scoreMath, int scoreCh) {
        super(name, sex, age);
        this.no = no;
        this.scoreEn = scoreEn;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }

    public double aver() {
        return (scoreEn + scoreMath + scoreCh) / 3.0;
    }

    public int max() {
        return Math.max(Math.max(scoreEn, scoreMath), scoreCh);
    }

    public int min() {
        return Math.min(Math.min(scoreEn, scoreMath), scoreCh);
    }

    @Override
    public String toString() {
        return super.toString() + ", 学号：" + no + ", 平均分：" + aver() + ", 最高分：" + max() + ", 最低分：" + min();
    }
}

public class Work4 {
    public static void main(String[] args) {
        Student student = new Student("汪粤杰", "男", 20, 1, 100, 100, 100);
        System.out.println(student);
    }
}